import { createRouter, createWebHistory } from 'vue-router'
import HomePage from '@v/HomePage'
const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: HomePage
  },
  {
    path: '/news',
    name: 'news',
    // 路由懒加载
    component: () => import('@v/NewsPage')
  },
  {
    path: '/about',
    name: 'about',
    // 路由懒加载
    component: () => import('@v/AboutPage')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
